package com.tensquare.notice.config;

import com.tensquare.notice.netty.NettyServer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author wz
 * @company 公司
 * @create 2020-02-25 14:28
 */
@Configuration
public class NettyConfig {

    @Bean
    public NettyServer createNettyServer(){
        NettyServer nettyServer = new NettyServer();

        //启动netty服务,采用新的线程
        new Thread(){
            @Override
            public void run() {
                nettyServer.start(1234);
            }
        }.start();

        return nettyServer;
    }

}
